package com.ruoyi.merchant.mapper;

import com.ruoyi.common.core.cg.pojo.Leader;
import com.ruoyi.common.core.cg.pojo.Users;
import com.ruoyi.merchant.dto.UserDTO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

/**
* @author ？？？
* @description 针对表【users】的数据库操作Mapper
* @createDate 2025-03-04 14:04:13
* @Entity generator.pojo.Users
*/
@Mapper
public interface UsersMapper {
    //验证码登录
    @Select("select * from leader where phone=#{phone}")
    Leader loginUser(String phone);

    //添加手机号
    @Insert("insert into leader(name,phone,password,idcard,invitation_code,money,create_time) values(#{name},#{phone},#{password},#{idcard},#{invitationCode},#{money},#{createTime})")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    int saveLeader(Leader leader);

    //登录功能
    Users login(String phone);

    //商家入驻
    int UserSave(Users users);

    //根据uid查询信息表
    UserDTO selectById(Integer uid);
}




